package com.cloud.demo.models.sys.controller;

import com.cloud.demo.common.enums.ResultEnum;
import com.cloud.demo.common.web.domain.respomse.Result;
import com.cloud.demo.models.sys.domain.UserDto;
import com.cloud.demo.models.sys.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sys/user")
public class SysUserController {
    @Autowired
    private SysUserService sysUserService;

    @PostMapping("login")
    public Result login(@RequestBody UserDto user){
        String token = sysUserService.Login(user);
        //后续返回jwt 采用security鉴权
        return Result.build(ResultEnum.SUCCESS,token);

    }

}
